package typeErasure.genericArray;

import edu.princeton.cs.algs4.In;

import java.util.ArrayList;
import java.util.Arrays;

public class Test {


    public static void main(String[] args) {


//        GenSet<String> genSet = new GenSet<>(String.class, 2);


        ArrayList la = new ArrayList();
        la.add("1");

        Integer[] arr = new Integer[]{1, 2, 3, 4};

        Integer[] arr2 = Arrays.copyOf(arr,5);


        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(arr2));

        arr[2] = 8;

        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(arr2));


        ArrayList list1 = new ArrayList();
        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.add(4);

        Object[] arr1 = list1.toArray();
        System.out.println(Arrays.toString(arr1));
        arr1[0] = 999;
        System.out.println(Arrays.toString(arr1));
        System.out.println(list1);




    }

}
